Fix four input parser defects found during User Guide key inventory - #2
Open
mohalinasre wants to merge 4 commits into
Open
Fix four input parser defects found during User Guide key inventory#2mohalinasre wants to merge 4 commits into
mohalinasre wants to merge 4 commits into
Conversation
The mesh_deformation block at zoneIO.cpp:161-164 was duplicated from the domain_motion block above it. The guard was updated to read mesh_deformation > stationary_parts but the value read on line 164 was left pointing at domain_motion > stationary_parts.
An invalid search_method was accepted by the parser and only detected later in nonconformalDataTransfer::create_transfer, which prints the bare string "error" to stdout and calls exit(1) with no reference to the offending key or value. Only stk_kdtree is supported: dataTransfer.cpp and surfaceComparator.cpp both hardcode stk::search::KDTREE, and surfaceComparator.cpp already rejects anything else via errorMsg. This makes interfaceIO.cpp consistent with that behaviour and reports the error while the input file is still in scope. The downstream exit(1) is left in place as a backstop.
The else branch guarding basicSettings["convergence_criteria"] reported a missing convergence_controls block, duplicated from the preceding check at controlsIO.cpp:373. A user with a valid convergence_controls block and no convergence_criteria block was told to add the block they already had.
The error message for a missing `boundaries` block printed an example headed `boundary_conditions`, which is not a valid key. The example was also malformed YAML: no space after the sequence dash, and sibling keys not indented under the sequence item. The corrected hint matches the form used in examples/risingBubble, examples/airfoil and examples/staticDroplet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four defects in the YAML input parsers, found while building an exhaustive key inventory for the User Guide. Each was re-verified against source in this clean develop checkout, not carried over from my working tree.
Behavioural (2)
zoneIO.cpp — the mesh_deformation stationary-parts block was duplicated from the domain_motion block above it. The guard was updated to mesh_deformation > stationary_parts but the read on line 164 still pointed at domain_motion > stationary_parts, so the read dereferenced an undefined node.
interfaceIO.cpp — search_method was accepted without validation. An invalid value was only caught later in nonconformalDataTransfer::create_transfer, which prints the bare string error to stdout and calls exit(1) with no reference to the key or value. Now rejected at parse time. Only stk_kdtree is supported — dataTransfer.cpp and surfaceComparator.cpp both hardcode stk::search::KDTREE, and surfaceComparator.cpp already rejects anything else via errorMsg, so this makes interfaceIO.cpp consistent with existing behaviour. The downstream exit(1) is left in place as a backstop.
Error messages (2)
controlsIO.cpp:444 — the else guarding convergence_criteria reported a missing convergence_controls block, duplicated from the check at :373. A user with a valid convergence_controls block was told to add the block they already had.
zoneIO.cpp:243 — the hint for a missing boundaries block showed an example headed boundary_conditions, which is not a valid key, and the example was itself malformed YAML (no space after the sequence dash, sibling keys not indented). Corrected to match the form used in examples/risingBubble, examples/airfoil and examples/staticDroplet.
Testing
2D build clean. Both behavioural fixes verified at runtime, logs below. No separate 3D build: none of the three files contain SPATIAL_DIM, so the preprocessed source is identical in both builds.
Not addressed (needs your call)
Dead keys displacement_interpolation_type and thermodynamicStateOption_: struct fields with enum maps but no parser reads them. Removing them is a public-API decision, implementing them is a feature — neither is mine to make.
non_conformal_method is read from the global expert_parameters block, not per-interface, so all interfaces necessarily share one method. Documented in the guide as behaviour; flagging in case it isn't intended.